generate libtool which groks llvm openmp on macOS, detect it#49
generate libtool which groks llvm openmp on macOS, detect it#49dimpase wants to merge 4 commits into
Conversation
dimpase
commented
May 21, 2026
the biggish changes are 1) m4/m4_ax_openmp.m4 - which is replacing ax_openmp.m4 with a patched mainline (autoconf 2.72) AC_OPENMP - still named AX_OPENMP - to understand "-Xpreprocessor -fopenmp" Apple clang flags. The advantage is that it's just better in the way of support and cleanup of the mess left from testing flags. 2) build-aux/ltmain.sh.in - modified libtool sources to include the upstream commit https://cgit.git.savannah.gnu.org/cgit/libtool.git/commit/?id=c9c59804175920990ae2dc9706fa23a2cd4717b0 The rest is small and needed to explicitly pass -lomp flag to the linker (this is llvm's libomp, not to be confused with incompatible GNU libgomp) and generate libtool from the included source. On Homebrew this can be tested by brew install libomp export CPATH=`brew --prefix`/opt/libomp/include export LIBRARY_PATH=`brew --prefix`/opt/libomp/lib ./configure --enable-openmp [etc]
|
there are a couple of issues here.
I don't know how to fix this easily. I guess a full-blown installation of libtool from source prior to building m4ri would do, but that's a bit of work for not too much gain. I'll see if this is feasible on the CI.
|
|
OK, the CI works now. It's a big ugly, but, well... |
| sudo DEBIAN_FRONTEND=noninteractive apt-get install autoconf automake libtool | ||
| sudo DEBIAN_FRONTEND=noninteractive apt-get install autoconf automake | ||
| cd /tmp | ||
| wget https://ftpmirror.gnu.org/libtool/libtool-2.5.4.tar.gz |
There was a problem hiding this comment.
I don't like this at all, this is asking for trouble. We shouldn't force a new libtool on Linux testing for OSX.
There was a problem hiding this comment.
we should not be held hostage by GitHub not updating their runners :-)
|
Well, libtool 2.5.4 has been released in Nov 2024. It's of course not new that Debian/Ubuntu is asleep at the wheel, along with GNU in general. Other major build systems such as cmake and meson support this sort of flags without any problems. And for a good reason - they are crucial to build code which loads tasks on GPUs.! |
|
besides, it does not matter for configured tarballs, one can |
|
I sympathise but I can't commit to maintaining code where the CI runs some hardcoded libtool version. Sorry. |
|
I can propose the following hack - detect the system libtool version in configure, and use it to fill the template in Would you accept this? |
|
I'm not actively ignoring this, just got a bunch on. |
|
in case, libtool 2.6.1, with the needed fix, will be out in a month or two. Hopefully it can make it into Homebrew at some point. Meanwhile, m4ri is a formula in Homebrew (not using OpenMP, they don't like patches to upstream packages). I'll submit m4rie to Homebrew this week. |
|
How does libtool 2.6.1 change this PR? Would it become redundant or would it need to be changed? |
|
with libtool 2.6.1, what's left here would be start using OpenMP in CI: |
|
okay cool, let's wait :) |